package com.my.webflux.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/2/18 22:26
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    
    @ExceptionHandler(ArithmeticException.class)
    public String error(ArithmeticException exception){
        System.out.println("发生了数学运算异常:" + exception);
        return "炸了，哈哈。。。。";
    }
    
}
